<?php

namespace app\sales\controller;

use app\admin\common\Base;
use app\admin\common\Order;
use think\Db;
//销货退货单
class Reinvsa extends Base
{
    public function index()
    {
        $data = $this->request->param();
        return (new Order) -> order_index($data,2); //所属类型 0，销售订单；1，销售单；2，退货单;3,购货订单，4，购货单，5，购货退货单  
    }

    //新建退货单
    public function add()
    {
        $data = $this->request->param();
        return (new Order) -> order_add($data,2);//订单类别;0,销售订单，1，销售单，2，销售退货单，3,购货订单，4，购货单，5，购货退货单
    }
   
      // 添加销售退货单-更新
    public function save()
    {
        $data = $this->request->param();
        return (new Order) -> order_save($data,2);//订单类别;0,销售订单，1，销售单，2，销售退货单，3,购货订单，4，购货单，5，购货退货单
    }


     //删除
    public function del()
    {
       $data = $this->request->param();
       return (new Order) -> order_del($data);
    }

    //审核与反审核
    public function shenhe($ids,$type)
    {
        $data = $this->request->param();
        return (new Order) -> order_shenhe($ids,$type,2);//订单类别;0,销售订单，1，销售单，2，销售退货单，3,购货订单，4，购货单，5，购货退货单
    }

    //对单与反撤销对单
    public function dd()
    {
       $data = $this->request->param();
       return (new Order) -> order_dd($data);
    }

    //订单详情
    public function edit()
    {
        $data = $this->request->param();
        return (new Order) -> order_edit($data,2);//订单类别;0,销售订单，1，销售单，2，销售退货单，3,购货订单，4，购货单，5，购货退货单
    }

    
      //编辑更新订单
    public function update()
    {
        $data = $this->request->param();
        return (new Order) -> order_update($data);
    }      
}
